#JAVA_PATH=/usr/java/latest
JAVA_PATH=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home

JAVA_FILES=	./src/jpave/annotator/*.java \
           	./src/jpave/database/*.java \
           	./src/jpave/dataholders/*.java \
           	./src/jpave/manager/*.java \
           	./src/jpave/qr/*.java \
           	./src/jpave/query_interface/*.java \
           	./src/jpave/textfile/*.java \
           	./src/util/algorithms/*.java \
           	./src/util/data_structures/*.java \
           	./src/util/methods/*.java \
           	./src/util/ui/*.java \
           	./src/assem/enums/*.java \
	        ./src/assem/*.java \
           	./src/assem/helpers/*.java \
           	./src/util/Debug/*.java \
	   		./src/cmp/compile/*.java \
	   		./src/cmp/compile/panels/*.java \
           	./src/cmp/database/*.java \
           	./src/cmp/dataholders/*.java \
           	./src/cmp/main/*.java \
	   		./src/cmp/viewer/*.java \
           	./src/cmp/viewer/panels/*.java \
           	./src/cmp/viewer/controls/*.java \
           	./src/cmp/viewer/table/*.java

CLASSES_EXT = -C ./classes_ext netscape -C ./classes_ext sun -C ./classes_ext com -C ./classes_ext org
CLASSES_STCW = -C ./classes jpave -C ./classes util -C ./classes assem -C ./src html -C ./src images
CLASSES_MTCW = -C ./classes cmp -C ./classes util -C ./classes jpave -C ./classes assem -C ./src html -C ./src images

all : clean build jars clean_classes  

build:
	$(JAVA_PATH)/bin/javac  -classpath ./classes_ext -sourcepath ./src/cmp:./src/jpave:./src/util:./src/assem -d ./classes $(JAVA_FILES)
	#find classes -name ".svn" -exec rm -rf {} \;

jars: build stcw_jar mtcw_jar

stcw_jar:
	$(JAVA_PATH)/bin/jar -cfm jars/stcw.jar manifest.add $(CLASSES_EXT) $(CLASSES_STCW)

mtcw_jar:
	$(JAVA_PATH)/bin/jar -cfm jars/mtcw.jar manifest.add $(CLASSES_EXT) $(CLASSES_MTCW)


clean_classes:
	rm -rf classes/*
	find src/ -iname "*.class" -exec rm {} \;
clean:
	rm -rf classes/*
	rm -rf jars/* 

